home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1 / Nebula One.iso / Utilities / Unix / cvs-960311 / info / cvs.info-3 (.txt) < prev    next >
GNU Info File  |  1996-01-24  |  51KB  |  923 lines

  1. This is Info file cvs.info, produced by Makeinfo-1.64 from the input
  2. file ./cvs.texinfo.
  3.    Copyright (C) 1992, 1993 Signum Support AB Copyright (C) 1993, 1994
  4. Free Software Foundation, Inc.
  5.    Permission is granted to make and distribute verbatim copies of this
  6. manual provided the copyright notice and this permission notice are
  7. preserved on all copies.
  8.    Permission is granted to copy and distribute modified versions of
  9. this manual under the conditions for verbatim copying, provided also
  10. that the section entitled "GNU General Public License" is included
  11. exactly as in the original, and provided that the entire resulting
  12. derived work is distributed under the terms of a permission notice
  13. identical to this one.
  14.    Permission is granted to copy and distribute translations of this
  15. manual into another language, under the above conditions for modified
  16. versions, except that the section entitled "GNU General Public License"
  17. and this permission notice may be included in translations approved by
  18. the Free Software Foundation instead of in the original English.
  19. File: cvs.info,  Node: Avoiding substitution,  Next: Substitution modes,  Prev: Using keywords,  Up: Keyword substitution
  20. Avoiding substitution
  21. =====================
  22.    Keyword substitution has its disadvantages.  Sometimes you might
  23. want the literal text string `$Author$' to appear inside a file without
  24. RCS interpreting it as a keyword and expanding it into something like
  25. `$Author: ceder $'.
  26.    There is unfortunately no way to selectively turn off keyword
  27. substitution.  You can use `-ko' (*note Substitution modes::.) to turn
  28. off keyword substitution entirely.
  29.    In many cases you can avoid using RCS keywords in the source, even
  30. though they appear in the final product.  For example, the source for
  31. this manual contains `$@asis{}Author$' whenever the text `$Author$'
  32. should appear.  In `nroff' and `troff' you can embed the null-character
  33. `\&' inside the keyword for a similar effect.
  34. File: cvs.info,  Node: Substitution modes,  Next: Log keyword,  Prev: Avoiding substitution,  Up: Keyword substitution
  35. Substitution modes
  36. ==================
  37.    You can control how RCS expands keywords through the use of the `-k'
  38. option (*note Common options::.).  The `-k' option is available with the
  39. `add', `checkout', `diff' and `update' commands.
  40.    The modes available are:
  41. `-kkv'
  42.      Generate keyword strings using the default form, e.g.  `$Revision:
  43.      5.7 $' for the `Revision' keyword.
  44. `-kkvl'
  45.      Like `-kkv', except that a locker's name is always inserted if the
  46.      given revision is currently locked.  This option is normally not
  47.      useful when CVS is used.
  48. `-kk'
  49.      Generate only keyword names in keyword strings; omit their values.
  50.      For example, for the `Revision' keyword, generate the string
  51.      `$Revision$' instead of `$Revision: 5.7 $'.  This option is useful
  52.      to ignore differences due to keyword substitution when comparing
  53.      different revisions of a file.
  54. `-ko'
  55.      Generate the old keyword string, present in the working file just
  56.      before it was checked in.  For example, for the `Revision'
  57.      keyword, generate the string `$Revision: 1.1 $' instead of
  58.      `$Revision: 5.7 $' if that is how the string appeared when the
  59.      file was checked in.
  60. `-kb'
  61.      Like `-ko', but also inhibit conversion of line endings between
  62.      the canonical form in which they are stored in the repository
  63.      (linefeed only), and the form appropriate to the operating system
  64.      in use on the client.  For systems, like unix, which use linefeed
  65.      only to terminate lines, this is the same as `-ko'.  For more
  66.      information on binary files, see *Note Binary files::.
  67. `-kv'
  68.      Generate only keyword values for keyword strings.  For example,
  69.      for the `Revision' keyword, generate the string `5.7' instead of
  70.      `$Revision: 5.7 $'.  This can help generate files in programming
  71.      languages where it is hard to strip keyword delimiters like
  72.      `$Revision: $' from a string.  However, further keyword
  73.      substitution cannot be performed once the keyword names are
  74.      removed, so this option should be used with care.
  75.      One often would like to use `-kv' with `cvs export'--*note
  76.      export::..  But be aware that doesn't handle an export containing
  77.      binary files correctly.
  78. File: cvs.info,  Node: Log keyword,  Prev: Substitution modes,  Up: Keyword substitution
  79. Problems with the $Log$ keyword.
  80. ================================
  81.    The `$Log$' keyword is somewhat controversial.  As long as you are
  82. working on your development system the information is easily accessible
  83. even if you do not use the `$Log$' keyword--just do a `cvs log'.  Once
  84. you export the file the history information might be useless anyhow.
  85.    A more serious concern is that RCS is not good at handling `$Log$'
  86. entries when a branch is merged onto the main trunk.  Conflicts often
  87. result from the merging operation.
  88.    People also tend to "fix" the log entries in the file (correcting
  89. spelling mistakes and maybe even factual errors).  If that is done the
  90. information from `cvs log' will not be consistent with the information
  91. inside the file.  This may or may not be a problem in real life.
  92.    It has been suggested that the `$Log$' keyword should be inserted
  93. *last* in the file, and not in the files header, if it is to be used at
  94. all.  That way the long list of change messages will not interfere with
  95. everyday source file browsing.
  96. File: cvs.info,  Node: Binary files,  Next: Revision management,  Prev: Keyword substitution,  Up: Top
  97. Handling binary files
  98. *********************
  99.    There are two issues with using CVS to store binary files.  The
  100. first is that CVS by default convert line endings between the canonical
  101. form in which they are stored in the repository (linefeed only), and
  102. the form appropriate to the operating system in use on the client (for
  103. example, carriage return followed by line feed for Windows NT).
  104.    The second is that a binary file might happen to contain data which
  105. looks like a keyword (*note Keyword substitution::.), so keyword
  106. expansion must be turned off.
  107.    The `-kb' option available with some CVS commands insures that
  108. neither line ending conversion nor keyword expansion will be done.  If
  109. you are using an old version of RCS without this option, and you are
  110. using an operating system, such as unix, which terminates lines with
  111. linefeeds only, you can use `-ko' instead; if you are on another
  112. operating system, upgrade to a version of RCS, such as 5.7 or later,
  113. which supports `-kb'.
  114.    Here is an example of how you can create a new file using the `-kb'
  115. flag:
  116.      $ echo '$Id$' > kotest
  117.      $ cvs add -kb -m"A test file" kotest
  118.      $ cvs ci -m"First checkin; contains a keyword" kotest
  119.    If a file accidentally gets added without `-kb', one can use the
  120. `cvs admin' command to recover.  For example:
  121.      $ echo '$Id$' > kotest
  122.      $ cvs add -m"A test file" kotest
  123.      $ cvs ci -m"First checkin; contains a keyword" kotest
  124.      $ cvs admin -kb kotest
  125.      $ rm kotest
  126.      $ cvs update kotest
  127.    When you check in the file `kotest' the keywords are expanded.  (Try
  128. the above example, and do a `cat kotest' after every command).  The `cvs
  129. admin -kb' command sets the default keyword substitution method for
  130. this file, but it does not alter the working copy of the file that you
  131. have.  The easiest way to get the unexpanded version of `kotest' is to
  132. remove it and check it out again.
  133. File: cvs.info,  Node: Revision management,  Next: Invoking CVS,  Prev: Binary files,  Up: Top
  134. Revision management
  135. *******************
  136.    If you have read this far, you probably have a pretty good grasp on
  137. what CVS can do for you.  This chapter talks a little about things that
  138. you still have to decide.
  139.    If you are doing development on your own using CVS you could
  140. probably skip this chapter.  The questions this chapter takes up become
  141. more important when more than one person is working in a repository.
  142. * Menu:
  143. * When to commit::              Some discussion on the subject
  144. File: cvs.info,  Node: When to commit,  Up: Revision management
  145. When to commit?
  146. ===============
  147.    Your group should decide which policy to use regarding commits.
  148. Several policies are possible, and as your experience with CVS grows
  149. you will probably find out what works for you.
  150.    If you commit files too quickly you might commit files that do not
  151. even compile.  If your partner updates his working sources to include
  152. your buggy file, he will be unable to compile the code.  On the other
  153. hand, other persons will not be able to benefit from the improvements
  154. you make to the code if you commit very seldom, and conflicts will
  155. probably be more common.
  156.    It is common to only commit files after making sure that they can be
  157. compiled.  Some sites require that the files pass a test suite.
  158. Policies like this can be enforced using the commitinfo file (*note
  159. commitinfo::.), but you should think twice before you enforce such a
  160. convention.  By making the development environment too controlled it
  161. might become too regimented and thus counter-productive to the real
  162. goal, which is to get software written.
  163. File: cvs.info,  Node: Invoking CVS,  Next: Administrative files,  Prev: Revision management,  Up: Top
  164. Reference manual for CVS commands
  165. *********************************
  166.    This appendix describes how to invoke CVS, and describes in detail
  167. those subcommands of CVS which are not fully described elsewhere.  To
  168. look up a particular subcommand, see *Note Index::.
  169. * Menu:
  170. * Structure::                   Overall structure of CVS commands
  171. * ~/.cvsrc::                    Default options with the ~/.csvrc file
  172. * Global options::              Options you give to the left of cvs_command
  173. * Common options::              Options you give to the right of cvs_command
  174. * add::                         Add a new file/directory to the repository
  175. * admin::                       Administration front end for rcs
  176. * checkout::                    Checkout sources for editing
  177. * commit::                      Check files into the repository
  178. * diff::                        Run diffs between revisions
  179. * export::                      Export sources from CVS, similar to checkout
  180. * history::                     Show status of files and users
  181. * import::                      Import sources into CVS, using vendor branches
  182. * log::                         Print out 'rlog' information for files
  183. * rdiff::                       'patch' format diffs between releases
  184. * release::                     Indicate that a Module is no longer in use
  185. * remove::                      Remove an entry from the repository
  186. * rtag::                        Add a tag to a module
  187. * status::                      Status info on the revisions
  188. * tag::                         Add a tag to checked out version
  189. * update::                      Bring work tree in sync with repository
  190. File: cvs.info,  Node: Structure,  Next: ~/.cvsrc,  Up: Invoking CVS
  191. Overall structure of CVS commands
  192. =================================
  193.    The first release of CVS consisted of a number of shell-scripts.
  194. Today CVS is implemented as a single program that is a front-end to RCS
  195. and `diff'. The overall format of all CVS commands is:
  196.      cvs [ cvs_options ] cvs_command [ command_options ] [ command_args ]
  197. `cvs'
  198.      The program that is a front-end to RCS.
  199. `cvs_options'
  200.      Some options that affect all sub-commands of CVS.  These are
  201.      described below.
  202. `cvs_command'
  203.      One of several different sub-commands.  Some of the commands have
  204.      aliases that can be used instead; those aliases are noted in the
  205.      reference manual for that command.  There are only two situations
  206.      where you may omit `cvs_command': `cvs -H' elicits a list of
  207.      available commands, and `cvs -v' displays version information on
  208.      CVS itself.
  209. `command_options'
  210.      Options that are specific for the command.
  211. `command_args'
  212.      Arguments to the commands.
  213.    There is unfortunately some confusion between `cvs_options' and
  214. `command_options'.  `-l', when given as a `cvs_option', only affects
  215. some of the commands.  When it is given as a `command_option' is has a
  216. different meaning, and is accepted by more commands.  In other words,
  217. do not take the above categorization too seriously.  Look at the
  218. documentation instead.
  219. File: cvs.info,  Node: ~/.cvsrc,  Next: Global options,  Prev: Structure,  Up: Invoking CVS
  220. Default options and the ~/.cvsrc file
  221. =====================================
  222.    There are some `command_options' that are used so often that you
  223. might have set up an alias or some other means to make sure you always
  224. specify that option.  One example (the one that drove the
  225. implementation of the .cvsrc support, actually) is that many people
  226. find the default output of the `diff' command to be very hard to read,
  227. and that either context diffs or unidiffs are much easier to understand.
  228.    The `~/.cvsrc' file is a way that you can add default options to
  229. `cvs_commands' within cvs, instead of relying on aliases or other shell
  230. scripts.
  231.    The format of the `~/.cvsrc' file is simple.  The file is searched
  232. for a line that begins with the same name as the `cvs_command' being
  233. executed.  If a match is found, then the remainder of the line is split
  234. up (at whitespace characters) into separate options and added to the
  235. command arguments *before* any options from the command line.
  236.    If a command has two names (e.g., `checkout' and `co'), the official
  237. name, not necessarily the one used on the command line, will be used to
  238. match against the file.  So if this is the contents of the user's
  239. `~/.cvsrc' file:
  240.      log -N
  241.      diff -u
  242.      update -P
  243.      co -P
  244. the command `cvs checkout foo' would have the `-P' option added to the
  245. arguments, as well as `cvs co foo'.
  246.    With the example file above, the output from `cvs diff foobar' will
  247. be in unidiff format.  `cvs diff -c foobar' will provide context diffs,
  248. as usual.  Getting "old" format diffs would be slightly more
  249. complicated, because `diff' doesn't have an option to specify use of
  250. the "old" format, so you would need `cvs -f diff foobar'.
  251. File: cvs.info,  Node: Global options,  Next: Common options,  Prev: ~/.cvsrc,  Up: Invoking CVS
  252. Global options
  253. ==============
  254.    The available `cvs_options' (that are given to the left of
  255. `cvs_command') are:
  256. `-b BINDIR'
  257.      Use BINDIR as the directory where RCS programs are located.
  258.      Overrides the setting of the `$RCSBIN' environment variable and
  259.      any precompiled directory.  This parameter should be specified as
  260.      an absolute pathname.
  261. `-d CVS_ROOT_DIRECTORY'
  262.      Use CVS_ROOT_DIRECTORY as the root directory pathname of the
  263.      repository.  Overrides the setting of the `$CVSROOT' environment
  264.      variable.  *Note Repository::.
  265. `-e EDITOR'
  266.      Use EDITOR to enter revision log information.  Overrides the
  267.      setting of the `$CVSEDITOR' and `$EDITOR' environment variables.
  268.      Do not read the `~/.cvsrc' file.  This option is most often used
  269.      because of the non-orthogonality of the CVS option set.  For
  270.      example, the `cvs log' option `-N' (turn off display of tag names)
  271.      does not have a corresponding option to turn the display on.  So
  272.      if you have `-N' in the `~/.cvsrc' entry for `diff', you may need
  273.      to use `-f' to show the tag names.  (1)
  274.      Display usage information about the specified `cvs_command' (but
  275.      do not actually execute the command).  If you don't specify a
  276.      command name, `cvs -H' displays a summary of all the commands
  277.      available.
  278.      Do not log the cvs_command in the command history (but execute it
  279.      anyway).  *Note history::, for information on command history.
  280.      Do not change any files.  Attempt to execute the `cvs_command',
  281.      but only to issue reports; do not remove, update, or merge any
  282.      existing files, or create any new files.
  283.      Cause the command to be really quiet; the command will only
  284.      generate output for serious problems.
  285.      Cause the command to be somewhat quiet; informational messages,
  286.      such as reports of recursion through subdirectories, are
  287.      suppressed.
  288.      Make new working files files read-only.  Same effect as if the
  289.      `$CVSREAD' environment variable is set (*note Environment
  290.      variables::.).  The default is to make working files writable.
  291.      Trace program execution; display messages showing the steps of CVS
  292.      activity.  Particularly useful with `-n' to explore the potential
  293.      impact of an unfamiliar command.
  294.      Display version and copyright information for CVS.
  295.      Make new working files read-write.  Overrides the setting of the
  296.      `$CVSREAD' environment variable.  Files are created read-write by
  297.      default, unless `$CVSREAD' is set or `-r' is given.
  298.    ---------- Footnotes ----------
  299.    (1)  Yes, this really should be fixed, and it's being worked on
  300. File: cvs.info,  Node: Common options,  Next: add,  Prev: Global options,  Up: Invoking CVS
  301. Common command options
  302. ======================
  303.    This section describes the `command_options' that are available
  304. across several CVS commands.  These options are always given to the
  305. right of `cvs_command'. Not all commands support all of these options;
  306. each option is only supported for commands where it makes sense.
  307. However, when a command has one of these options you can almost always
  308. count on the same behavior of the option as in other commands.  (Other
  309. command options, which are listed with the individual commands, may have
  310. different behavior from one CVS command to the other).
  311.    *Warning:* the `history' command is an exception; it supports many
  312. options that conflict even with these standard options.
  313. `-D DATE_SPEC'
  314.      Use the most recent revision no later than DATE_SPEC.  DATE_SPEC
  315.      is a single argument, a date description specifying a date in the
  316.      past.
  317.      The specification is "sticky" when you use it to make a private
  318.      copy of a source file; that is, when you get a working file using
  319.      `-D', CVS records the date you specified, so that further updates
  320.      in the same directory will use the same date (unless you
  321.      explicitly override it; *note update::.).
  322.      A wide variety of date formats are supported by the underlying RCS
  323.      facilities, similar to those described in co(1), but not exactly
  324.      the same.  The DATE_SPEC is interpreted as being in the local
  325.      timezone, unless a specific timezone is specified.  Examples of
  326.      valid date specifications include:
  327.                               1 month ago
  328.                               2 hours ago
  329.                               400000 seconds ago
  330.                               last year
  331.                               last Monday
  332.                               yesterday
  333.                               a fortnight ago
  334.                               3/31/92 10:00:07 PST
  335.                               January 23, 1987 10:05pm
  336.                               22:00 GMT
  337.      `-D' is available with the `checkout', `diff', `export', `history',
  338.      `rdiff', `rtag', and `update' commands.  (The `history' command
  339.      uses this option in a slightly different way; *note history
  340.      options::.).
  341.      Remember to quote the argument to the `-D' flag so that your shell
  342.      doesn't interpret spaces as argument separators.  A command using
  343.      the `-D' flag can look like this:
  344.           $ cvs diff -D "1 hour ago" cvs.texinfo
  345.      When you specify a particular date or tag to CVS commands, they
  346.      normally ignore files that do not contain the tag (or did not
  347.      exist prior to the date) that you specified.  Use the `-f' option
  348.      if you want files retrieved even when there is no match for the
  349.      tag or date.  (The most recent revision of the file will be used).
  350.      `-f' is available with these commands: `checkout', `export',
  351.      `rdiff', `rtag', and `update'.
  352.      *Warning:*  The `commit' command also has a `-f' option, but it
  353.      has a different behavior for that command.  *Note commit options::.
  354.      Help; describe the options available for this command.  This is
  355.      the only option supported for all CVS commands.
  356. `-k KFLAG'
  357.      Alter the default RCS processing of keywords.  *Note Keyword
  358.      substitution::, for the meaning of KFLAG.  Your KFLAG
  359.      specification is "sticky" when you use it to create a private copy
  360.      of a source file; that is, when you use this option with the
  361.      `checkout' or `update' commands, CVS associates your selected
  362.      KFLAG with the file, and continues to use it with future update
  363.      commands on the same file until you specify otherwise.
  364.      The `-k' option is available with the `add', `checkout', `diff' and
  365.      `update' commands.
  366.      Local; run only in current working directory, rather than
  367.      recursing through subdirectories.
  368.      *Warning:* this is not the same as the overall `cvs -l' option,
  369.      which you can specify to the left of a cvs command!
  370.      Available with the following commands: `checkout', `commit',
  371.      `diff', `export', `log', `remove', `rdiff', `rtag', `status',
  372.      `tag', and `update'.
  373. `-m MESSAGE'
  374.      Use MESSAGE as log information, instead of invoking an editor.
  375.      Available with the following commands: `add', `commit' and
  376.      `import'.
  377.      Do not run any checkout/commit/tag program.  (A program can be
  378.      specified to run on each of these activities, in the modules
  379.      database (*note modules::.); this option bypasses it).
  380.      *Warning:* this is not the same as the overall `cvs -n' option,
  381.      which you can specify to the left of a cvs command!
  382.      Available with the `checkout', `commit', `export', and `rtag'
  383.      commands.
  384.      Prune (remove) directories that are empty after being updated, on
  385.      `checkout', or `update'.  Normally, an empty directory (one that
  386.      is void of revision-controlled files) is left alone.  Specifying
  387.      `-P' will cause these directories to be silently removed from your
  388.      checked-out sources.  This does not remove the directory from the
  389.      repository, only from your checked out copy.  Note that this
  390.      option is implied by the `-r' or `-D' options of `checkout' and
  391.      `export'.
  392.      Pipe the files retrieved from the repository to standard output,
  393.      rather than writing them in the current directory.  Available with
  394.      the `checkout' and `update' commands.
  395.      Specify file names that should be filtered.  You can use this
  396.      option repeatedly.  The spec can be a file name pattern of the
  397.      same type that you can specify in the `.cvswrappers' file.
  398.      Avaliable with the following commands: `import', and `update'.
  399. `-r TAG'
  400.      Use the revision specified by the TAG argument instead of the
  401.      default "head" revision.  As well as arbitrary tags defined with
  402.      the `tag' or `rtag' command, two special tags are always
  403.      available: `HEAD' refers to the most recent version available in
  404.      the repository, and `BASE' refers to the revision you last checked
  405.      out into the current working directory.
  406.      The tag specification is sticky when you use this option with
  407.      `checkout' or `update' to make your own copy of a file: CVS
  408.      remembers the tag and continues to use it on future update
  409.      commands, until you specify otherwise.  The tag can be either a
  410.      symbolic or numeric tag.  *Note Tags::.
  411.      Specifying the `-q' global option along with the `-r' command
  412.      option is often useful, to suppress the warning messages when the
  413.      RCS history file does not contain the specified tag.
  414.      *Warning:* this is not the same as the overall `cvs -r' option,
  415.      which you can specify to the left of a cvs command!
  416.      `-r' is available with the `checkout', `commit', `diff',
  417.      `history', `export', `rdiff', `rtag', and `update' commands.
  418. File: cvs.info,  Node: add,  Next: admin,  Prev: Common options,  Up: Invoking CVS
  419. add--Add a new file/directory to the repository
  420. ===============================================
  421.    * Synopsis: add [-k kflag] [-m 'message'] files...
  422.    * Requires: repository, working directory.
  423.    * Changes: working directory.
  424.    * Synonym: new
  425.    Use the `add' command to create a new file or directory in the
  426. source repository.  The files or directories specified with `add' must
  427. already exist in the current directory (which must have been created
  428. with the `checkout' command).  To add a whole new directory hierarchy
  429. to the source repository (for example, files received from a
  430. third-party vendor), use the `import' command instead.  *Note import::.
  431.    If the argument to `add' refers to an immediate sub-directory, the
  432. directory is created at the correct place in the source repository, and
  433. the necessary CVS administration files are created in your working
  434. directory.  If the directory already exists in the source repository,
  435. `add' still creates the administration files in your version of the
  436. directory.  This allows you to use `add' to add a particular directory
  437. to your private sources even if someone else created that directory
  438. after your checkout of the sources.  You can do the following:
  439.      $ mkdir new_directory
  440.      $ cvs add new_directory
  441.      $ cvs update new_directory
  442.    An alternate approach using `update' might be:
  443.      $ cvs update -d new_directory
  444.    (To add any available new directories to your working directory,
  445. it's probably simpler to use `checkout' (*note checkout::.) or `update
  446. -d' (*note update::.)).
  447.    The added files are not placed in the source repository until you
  448. use `commit' to make the change permanent.  Doing an `add' on a file
  449. that was removed with the `remove' command will resurrect the file,
  450. unless a `commit' command intervened.  *Note remove examples:: for an
  451. example.
  452.    Unlike most other commands `add' never recurses down directories.
  453. It cannot yet handle relative paths.  Instead of
  454.      $ cvs add foo/bar.c
  455.    you have to do
  456.      $ cd foo
  457.      $ cvs add bar.c
  458. * Menu:
  459. * add options::                 add options
  460. * add examples::                add examples
  461. File: cvs.info,  Node: add options,  Next: add examples,  Up: add
  462. add options
  463. -----------
  464.    There are only two options you can give to `add':
  465. `-k KFLAG'
  466.      This option specifies the default way that this file will be
  467.      checked out.  The KFLAG argument (*note Substitution modes::.) is
  468.      stored in the RCS file and can be changed with `admin -k' (*note
  469.      admin options::.).  See *Note Binary files::, for information on
  470.      using this option for binary files.
  471. `-m DESCRIPTION'
  472.      Using this option, you can give a description for the file.  This
  473.      description appears in the history log (if it is enabled, *note
  474.      history file::.).  It will also be saved in the RCS history file
  475.      inside the repository when the file is committed.  The `log'
  476.      command displays this description.
  477.      The description can be changed using `admin -t'.  *Note admin::.
  478.      If you omit the `-m DESCRIPTION' flag, an empty string will be
  479.      used.  You will not be prompted for a description.
  480. File: cvs.info,  Node: add examples,  Prev: add options,  Up: add
  481. add examples
  482. ------------
  483.    To add the file `backend.c' to the repository, with a description,
  484. the following can be used.
  485.      $ cvs add -m "Optimizer and code generation passes." backend.c
  486.      $ cvs commit -m "Early version. Not yet compilable." backend.c
  487. File: cvs.info,  Node: admin,  Next: checkout,  Prev: add,  Up: Invoking CVS
  488. admin--Administration front end for rcs
  489. =======================================
  490.    * Requires: repository, working directory.
  491.    * Changes: repository.
  492.    * Synonym: rcs
  493.    This is the CVS interface to assorted administrative RCS facilities,
  494. documented in rcs(1).  `admin' simply passes all its options and
  495. arguments to the `rcs' command; it does no filtering or other
  496. processing.  This command *does* work recursively, however, so extreme
  497. care should be used.
  498.    If there is a group whose name matches a compiled in value which
  499. defaults to `cvsadmin', only members of that group can use `cvs admin'.
  500. To disallow `cvs admin' for all users, create a group with no users in
  501. * Menu:
  502. * admin options::               admin options
  503. * admin examples::              admin examples
  504. File: cvs.info,  Node: admin options,  Next: admin examples,  Up: admin
  505. admin options
  506. -------------
  507.    Not all valid `rcs' options are useful together with CVS.  Some even
  508. makes it impossible to use CVS until you undo the effect!
  509.    This description of the available options is based on the `rcs(1)'
  510. man page, but modified to suit readers that are more interrested in CVS
  511. than RCS.
  512. `-AOLDFILE'
  513.      Might not work together with CVS.  Append the access list of
  514.      OLDFILE to the access list of the RCS file.
  515. `-aLOGINS'
  516.      Might not work together with CVS.  Append the login names
  517.      appearing in the comma-separated list LOGINS to the access list of
  518.      the RCS file.
  519. `-b[REV]'
  520.      Breaks CVS.  When used with bare RCS, this option sets the default
  521.      branch to REV.  If REV is omitted, the default branch is reset to
  522.      the (dynamically) highest branch on the trunk.  Use sticky tags
  523.      instead, as in `cvs co -r'.  *Note Sticky tags::.
  524. `-cSTRING'
  525.      Useful with CVS.  Sets the comment leader to STRING.  The comment
  526.      leader is printed before every log message line generated by the
  527.      keyword `$Log$' (*note Keyword substitution::.).  This is useful
  528.      for programming languages without multi-line comments.  RCS
  529.      initially guesses the value of the comment leader from the file
  530.      name extension when the file is first committed.
  531. `-e[LOGINS]'
  532.      Might not work together with CVS.  Erase the login names appearing
  533.      in the comma-separated list LOGINS from the access list of the RCS
  534.      file.  If LOGINS is omitted, erase the entire access list.
  535.      Run interactively, even if the standard input is not a terminal.
  536.      Useless with CVS.  When using bare RCS, this is used to create and
  537.      initialize a new RCS file, without depositing a revision.
  538. `-kSUBST'
  539.      Useful with CVS.  Set the default keyword substitution to SUBST.
  540.      *Note Keyword substitution::.  Giving an explicit `-k' option to
  541.      `cvs update' or `cvs checkout' overrides this default.  `cvs
  542.      export' always uses `-kv', regardless of which keyword
  543.      substitution is set with `cvs admin'.
  544. `-l[REV]'
  545.      Probably useless with CVS.  With bare RCS, this option can be used
  546.      to lock the revision with number REV.  If a branch is given, lock
  547.      the latest revision on that branch.  If REV is omitted, lock the
  548.      latest revision on the default branch.
  549.      Probably useless with CVS.  Used with bare RCS to set locking to
  550.      strict.  Strict locking means that the owner of an RCS file is not
  551.      exempt from locking for checkin.
  552. `-mREV:MSG'
  553.      Replace the log message of revision REV with MSG.
  554. `-NNAME[:[REV]]'
  555.      Act like `-n', except override any previous assignment of NAME.
  556. `-nNAME[:[REV]]'
  557.      Associate the symbolic name NAME with the branch or revision REV.
  558.      It is normally better to use `cvs tag' or `cvs rtag' instead.
  559.      Delete the symbolic name if both `:' and REV are omitted;
  560.      otherwise, print an error message if NAME is already associated
  561.      with another number.  If REV is symbolic, it is expanded before
  562.      association.  A REV consisting of a branch number followed by a
  563.      `.' stands for the current latest revision in the branch.  A `:'
  564.      with an empty REV stands for the current latest revision on the
  565.      default branch, normally the trunk.  For example, `rcs -nNAME:
  566.      RCS/*' associates NAME with the current latest revision of all the
  567.      named RCS files; this contrasts with `rcs -nNAME:$ RCS/*' which
  568.      associates NAME with the revision numbers extracted from keyword
  569.      strings in the corresponding working files.
  570. `-oRANGE'
  571.      Potentially useful, but dangerous, with CVS (see below).  Deletes
  572.      ("outdates") the revisions given by RANGE.  A range consisting of
  573.      a single revision number means that revision.  A range consisting
  574.      of a branch number means the latest revision on that branch.  A
  575.      range of the form `REV1:REV2' means revisions REV1 to REV2 on the
  576.      same branch, `:REV' means from the beginning of the branch
  577.      containing REV up to and including REV, and `REV:' means from
  578.      revision REV to the end of the branch containing REV.  None of the
  579.      outdated revisions may have branches or locks.
  580.      Due to the way CVS handles branches REV cannot be specified
  581.      symbolically if it is a branch.  *Note Magic branch numbers::, for
  582.      an explanation.
  583.      Make sure that no-one has checked out a copy of the revision you
  584.      outdate.  Strange things will happen if he starts to edit it and
  585.      tries to check it back in.  For this reason, this option is not a
  586.      good way to take back a bogus commit; commit a new revision
  587.      undoing the bogus change instead (*note Merging two revisions::.).
  588.      Run quietly; do not print diagnostics.
  589. `-sSTATE[:REV]'
  590.      Useful with CVS.  Set the state attribute of the revision REV to
  591.      STATE.  If REV is a branch number, assume the latest revision on
  592.      that branch.  If REV is omitted, assume the latest revision on the
  593.      default branch.  Any identifier is acceptable for STATE.  A useful
  594.      set of states is `Exp' (for experimental), `Stab' (for stable),
  595.      and `Rel' (for released).  By default, the state of a new revision
  596.      is set to `Exp' when it is created.  The state is visible in the
  597.      output from CVS LOG (*note log::.), and in the `$Log$' and
  598.      `$State$' keywords (*note Keyword substitution::.).
  599. `-t[FILE]'
  600.      Useful with CVS.  Write descriptive text from the contents of the
  601.      named FILE into the RCS file, deleting the existing text.  The
  602.      FILE pathname may not begin with `-'.  If FILE is omitted, obtain
  603.      the text from standard input, terminated by end-of-file or by a
  604.      line containing `.' by itself.  Prompt for the text if interaction
  605.      is possible; see `-I'.  The descriptive text can be seen in the
  606.      output from `cvs log' (*note log::.).
  607. `-t-STRING'
  608.      Similar to `-tFILE'. Write descriptive text from the STRING into
  609.      the RCS file, deleting the existing text.
  610.      Probably useless with CVS.  Used with bare RCS to set locking to
  611.      non-strict.  Non-strict locking means that the owner of a file
  612.      need not lock a revision for checkin.
  613. `-u[REV]'
  614.      Probably useless with CVS.  With bare RCS, unlock the revision
  615.      with number REV.  If a branch is given, unlock the latest revision
  616.      on that branch.  If REV is omitted, remove the latest lock held by
  617.      the caller.  Normally, only the locker of a revision may unlock
  618.      it.  Somebody else unlocking a revision breaks the lock.  This
  619.      causes a mail message to be sent to the original locker.  The
  620.      message contains a commentary solicited from the breaker.  The
  621.      commentary is terminated by end-of-file or by a line containing
  622.      `.' by itself.
  623. `-VN'
  624.      Emulate RCS version N. Use -VN to make an RCS file acceptable to
  625.      RCS version N by discarding information that would confuse version
  626.      N.
  627. `-xSUFFIXES'
  628.      Useless with CVS. Use SUFFIXES to characterize RCS files.
  629. File: cvs.info,  Node: admin examples,  Prev: admin options,  Up: admin
  630. admin examples
  631. --------------
  632. Outdating is dangerous
  633. ......................
  634.    First, an example of how *not* to use the `admin' command.  It is
  635. included to stress the fact that this command can be quite dangerous
  636. unless you know *exactly* what you are doing.
  637.    The `-o' option can be used to "outdate" old revisions from the
  638. history file.  If you are short on disc this option might help you.
  639. But think twice before using it--there is no way short of restoring the
  640. latest backup to undo this command!
  641.    The next line is an example of a command that you would *not* like
  642. to execute.
  643.      $ cvs admin -o:R_1_02 .
  644.    The above command will delete all revisions up to, and including,
  645. the revision that corresponds to the tag R_1_02.  But beware!  If there
  646. are files that have not changed between R_1_02 and R_1_03 the file will
  647. have *the same* numerical revision number assigned to the tags R_1_02
  648. and R_1_03.  So not only will it be impossible to retrieve R_1_02;
  649. R_1_03 will also have to be restored from the tapes!
  650. Comment leaders
  651. ...............
  652.    If you use the `$Log$' keyword and you do not agree with the guess
  653. for comment leader that CVS has done, you can enforce your will with
  654. `cvs admin -c'.  This might be suitable for `nroff' source:
  655.      $ cvs admin -c'.\" ' *.man
  656.      $ rm *.man
  657.      $ cvs update
  658.    The two last steps are to make sure that you get the versions with
  659. correct comment leaders in your working files.
  660. File: cvs.info,  Node: checkout,  Next: commit,  Prev: admin,  Up: Invoking CVS
  661. checkout--Check out sources for editing
  662. =======================================
  663.    * Synopsis: checkout [options] modules...
  664.    * Requires: repository.
  665.    * Changes: working directory.
  666.    * Synonyms: co, get
  667.    Make a working directory containing copies of the source files
  668. specified by MODULES.  You must execute `checkout' before using most of
  669. the other CVS commands, since most of them operate on your working
  670. directory.
  671.    The MODULES part of the command are either symbolic names for some
  672. collection of source directories and files, or paths to directories or
  673. files in the repository.  The symbolic names are defined in the
  674. `modules' file.  *Note modules::.
  675.    Depending on the modules you specify, `checkout' may recursively
  676. create directories and populate them with the appropriate source files.
  677. You can then edit these source files at any time (regardless of
  678. whether other software developers are editing their own copies of the
  679. sources); update them to include new changes applied by others to the
  680. source repository; or commit your work as a permanent change to the
  681. source repository.
  682.    Note that `checkout' is used to create directories.  The top-level
  683. directory created is always added to the directory where `checkout' is
  684. invoked, and usually has the same name as the specified module.  In the
  685. case of a module alias, the created sub-directory may have a different
  686. name, but you can be sure that it will be a sub-directory, and that
  687. `checkout' will show the relative path leading to each file as it is
  688. extracted into your private work area (unless you specify the `-Q'
  689. global option).
  690.    The files created by `checkout' are created read-write, unless the
  691. `-r' option to CVS (*note Global options::.) is specified, the
  692. `CVSREAD' environment variable is specified (*note Environment
  693. variables::.), or a watch is in effect for that file (*note Watches::.).
  694.    Running `checkout' on a directory that was already built by a prior
  695. `checkout' is also permitted, and has the same effect as specifying the
  696. `-d' option to the `update' command, that is, any new directories that
  697. have been created in the repository will appear in your work area.
  698. *Note update::.
  699. * Menu:
  700. * checkout options::            checkout options
  701. * checkout examples::           checkout examples
  702. File: cvs.info,  Node: checkout options,  Next: checkout examples,  Up: checkout
  703. checkout options
  704. ----------------
  705.    These standard options are supported by `checkout' (*note Common
  706. options::., for a complete description of them):
  707. `-D DATE'
  708.      Use the most recent revision no later than DATE.  This option is
  709.      sticky, and implies `-P'.
  710.      Only useful with the `-D DATE' or `-r TAG' flags.  If no matching
  711.      revision is found, retrieve the most recent revision (instead of
  712.      ignoring the file).
  713. `-k KFLAG'
  714.      Process RCS keywords according to KFLAG.  See co(1).  This option
  715.      is sticky; future updates of this file in this working directory
  716.      will use the same KFLAG.  The `status' command can be viewed to
  717.      see the sticky options.  *Note status::.
  718.      Local; run only in current working directory.
  719.      Do not run any checkout program (as specified with the `-o' option
  720.      in the modules file; *note modules::.).
  721.      Prune empty directories.
  722.      Pipe files to the standard output.
  723. `-r TAG'
  724.      Use revision TAG.  This option is sticky, and implies `-P'.
  725.    In addition to those, you can use these special command options with
  726. `checkout':
  727.      Reset any sticky tags, dates, or `-k' options.  (If you get a
  728.      working file using one of the `-r', `-D', or `-k' options, CVS
  729.      remembers the corresponding tag, date, or KFLAG and continues using
  730.      it for future updates; use the `-A' option to make CVS forget
  731.      these specifications, and retrieve the `head' revision of the
  732.      file).
  733.      Copy the module file, sorted, to the standard output, instead of
  734.      creating or modifying any files or directories in your working
  735.      directory.
  736. `-d DIR'
  737.      Create a directory called DIR for the working files, instead of
  738.      using the module name.  Unless you also use `-N', the paths
  739.      created under DIR will be as short as possible.
  740. `-j TAG'
  741.      With two `-j' options, merge changes from the revision specified
  742.      with the first `-j' option to the revision specified with the
  743.      second `j' option, into the working directory.
  744.      With one `-j' option, merge changes from the ancestor revision to
  745.      the revision specified with the `-j' option, into the working
  746.      directory.  The ancestor revision is the common ancestor of the
  747.      revision which the working directory is based on, and the revision
  748.      specified in the `-j' option.
  749.      In addition, each -j option can contain an optional date
  750.      specification which, when used with branches, can limit the chosen
  751.      revision to one within a specific date.  An optional date is
  752.      specified by adding a colon (:) to the tag:
  753.      `-jSYMBOLIC_TAG:DATE_SPECIFIER'.
  754.      *Note Merging::.
  755.      Only useful together with `-d DIR'.  With this option, CVS will
  756.      not shorten module paths in your working directory.  (Normally,
  757.      CVS shortens paths as much as possible when you specify an
  758.      explicit target directory).
  759.      Like `-c', but include the status of all modules, and sort it by
  760.      the status string.  *Note modules::, for info about the `-s'
  761.      option that is used inside the modules file to set the module
  762.      status.
  763. File: cvs.info,  Node: checkout examples,  Prev: checkout options,  Up: checkout
  764. checkout examples
  765. -----------------
  766.    Get a copy of the module `tc':
  767.      $ cvs checkout tc
  768.    Get a copy of the module `tc' as it looked one day ago:
  769.      $ cvs checkout -D yesterday tc
  770. File: cvs.info,  Node: commit,  Next: diff,  Prev: checkout,  Up: Invoking CVS
  771. commit--Check files into the repository
  772. =======================================
  773.    * Version 1.3 Synopsis: commit [-lnR] [-m 'log_message' | -f file]
  774.      [-r revision] [files...]
  775.    * Version 1.3.1 Synopsis: commit [-lnRf] [-m 'log_message' | -F
  776.      file] [-r revision] [files...]
  777.    * Requires: working directory, repository.
  778.    * Changes: repository.
  779.    * Synonym: ci
  780.    *Warning:* The `-f FILE' option will probably be renamed to `-F
  781. FILE', and `-f' will be given a new behavior in future releases of CVS.
  782.    Use `commit' when you want to incorporate changes from your working
  783. source files into the source repository.
  784.    If you don't specify particular files to commit, all of the files in
  785. your working current directory are examined.  `commit' is careful to
  786. change in the repository only those files that you have really changed.
  787. By default (or if you explicitly specify the `-R' option), files in
  788. subdirectories are also examined and committed if they have changed;
  789. you can use the `-l' option to limit `commit' to the current directory
  790. only.
  791.    `commit' verifies that the selected files are up to date with the
  792. current revisions in the source repository; it will notify you, and
  793. exit without committing, if any of the specified files must be made
  794. current first with `update' (*note update::.).  `commit' does not call
  795. the `update' command for you, but rather leaves that for you to do when
  796. the time is right.
  797.    When all is well, an editor is invoked to allow you to enter a log
  798. message that will be written to one or more logging programs (*note
  799. modules::., and *note loginfo::.) and placed in the RCS history file
  800. inside the repository.  This log message can be retrieved with the
  801. `log' command; *Note log::.  You can specify the log message on the
  802. command line with the `-m MESSAGE' option, and thus avoid the editor
  803. invocation, or use the `-f FILE' option to specify that the argument
  804. file contains the log message.
  805. * Menu:
  806. * commit options::              commit options
  807. * commit examples::             commit examples
  808. File: cvs.info,  Node: commit options,  Next: commit examples,  Up: commit
  809. commit options
  810. --------------
  811.    These standard options are supported by `commit' (*note Common
  812. options::., for a complete description of them):
  813.      Local; run only in current working directory.
  814.      Do not run any module program.
  815.      Commit directories recursively.  This is on by default.
  816. `-r REVISION'
  817.      Commit to REVISION.  REVISION must be either a branch, or a
  818.      revision on the main trunk that is higher than any existing
  819.      revision number.  You cannot commit to a specific revision on a
  820.      branch.
  821.    `commit' also supports these options:
  822. `-F FILE'
  823.      This option is present in CVS releases 1.3-s3 and later.  Read the
  824.      log message from FILE, instead of invoking an editor.
  825.      This option is present in CVS 1.3-s3 and later releases of CVS.
  826.      Note that this is not the standard behavior of the `-f' option as
  827.      defined in *Note Common options::.
  828.      Force CVS to commit a new revision even if you haven't made any
  829.      changes to the file.  If the current revision of FILE is 1.7, then
  830.      the following two commands are equivalent:
  831.           $ cvs commit -f FILE
  832.           $ cvs commit -r 1.8 FILE
  833. `-f FILE'
  834.      This option is present in CVS releases 1.3, 1.3-s1 and 1.3-s2.
  835.      Note that this is not the standard behavior of the `-f' option as
  836.      defined in *Note Common options::.
  837.      Read the log message from FILE, instead of invoking an editor.
  838. `-m MESSAGE'
  839.      Use MESSAGE as the log message, instead of invoking an editor.
  840. File: cvs.info,  Node: commit examples,  Prev: commit options,  Up: commit
  841. commit examples
  842. ---------------
  843. New major release number
  844. ........................
  845.    When you make a major release of your product, you might want the
  846. revision numbers to track your major release number.  You should
  847. normally not care about the revision numbers, but this is a thing that
  848. many people want to do, and it can be done without doing any harm.
  849.    To bring all your files up to the RCS revision 3.0 (including those
  850. that haven't changed), you might do:
  851.      $ cvs commit -r 3.0
  852.    Note that it is generally a bad idea to try to make the RCS revision
  853. number equal to the current release number of your product.  You should
  854. think of the revision number as an internal number that the CVS package
  855. maintains, and that you generally never need to care much about.  Using
  856. the `tag' and `rtag' commands you can give symbolic names to the
  857. releases instead.  *Note tag:: and *Note rtag::.
  858.    Note that the number you specify with `-r' must be larger than any
  859. existing revision number.  That is, if revision 3.0 exists, you cannot
  860. `cvs commit -r 1.3'.
  861. Committing to a branch
  862. ......................
  863.    You can commit to a branch revision (one that has an even number of
  864. dots) with the `-r' option.  To create a branch revision, use the `-b'
  865. option of the `rtag' or `tag' commands (*note tag::.  or *note
  866. rtag::.).  Then, either `checkout' or `update' can be used to base your
  867. sources on the newly created branch.  From that point on, all `commit'
  868. changes made within these working sources will be automatically added
  869. to a branch revision, thereby not disturbing main-line development in
  870. any way.  For example, if you had to create a patch to the 1.2 version
  871. of the product, even though the 2.0 version is already under
  872. development, you might do:
  873.      $ cvs rtag -b -r FCS1_2 FCS1_2_Patch product_module
  874.      $ cvs checkout -r FCS1_2_Patch product_module
  875.      $ cd product_module
  876.      [[ hack away ]]
  877.      $ cvs commit
  878. This works automatically since the `-r' option is sticky.
  879. Creating the branch after editing
  880. .................................
  881.    Say you have been working on some extremely experimental software,
  882. based on whatever revision you happened to checkout last week.  If
  883. others in your group would like to work on this software with you, but
  884. without disturbing main-line development, you could commit your change
  885. to a new branch.  Others can then checkout your experimental stuff and
  886. utilize the full benefit of CVS conflict resolution.  The scenario might
  887. look like:
  888.      [[ hacked sources are present ]]
  889.      $ cvs tag -b EXPR1
  890.      $ cvs update -r EXPR1
  891.      $ cvs commit
  892.    The `update' command will make the `-r EXPR1' option sticky on all
  893. files.  Note that your changes to the files will never be removed by the
  894. `update' command.  The `commit' will automatically commit to the
  895. correct branch, because the `-r' is sticky.  You could also do like
  896. this:
  897.      [[ hacked sources are present ]]
  898.      $ cvs tag -b EXPR1
  899.      $ cvs commit -r EXPR1
  900. but then, only those files that were changed by you will have the `-r
  901. EXPR1' sticky flag.  If you hack away, and commit without specifying
  902. the `-r EXPR1' flag, some files may accidentally end up on the main
  903. trunk.
  904.    To work with you on the experimental change, others would simply do
  905.      $ cvs checkout -r EXPR1 whatever_module
  906. File: cvs.info,  Node: diff,  Next: export,  Prev: commit,  Up: Invoking CVS
  907. diff--Run diffs between revisions
  908. =================================
  909.    * Synopsis: diff [-l] [rcsdiff_options] [[-r rev1 | -D date1] [-r
  910.      rev2 |  -D date2]] [files...]
  911.    * Requires: working directory, repository.
  912.    * Changes: nothing.
  913.    The `diff' command is used to compare different revisions of files.
  914. The default action is to compare your working files with the revisions
  915. they were based on, and report any differences that are found.
  916.    If any file names are given, only those files are compared.  If any
  917. directories are given, all files under them will be compared.
  918.    The exit status will be 0 if no differences were found, 1 if some
  919. differences were found, and 2 if any error occurred.
  920. * Menu:
  921. * diff options::                diff options
  922. * diff examples::               diff examples
  923.